<include file="Public/header" />
<title>管理员列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单管理 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20" style="margin-top:-20px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<form class="formleft" name="" id="" action="__URL__/order/" method="get">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['order_no']}>" placeholder="订单编号" name="order_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['logistics_no']}>" placeholder="运单号" name="logistics_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_name']}>" placeholder="收件人姓名" name="user_name">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_idcard']}>" placeholder="身份证号" name="user_idcard">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_phone']}>" placeholder="收件人电话" name="user_phone">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_address']}>" placeholder="收件人地址" name="user_address">
			<br>
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['sendMan']}>" placeholder="发货人" name="sendMan">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['goods_name']}>" placeholder="商品名称" name="goods_name">
			<select name="pay_status" class="select input-text" style="width:150px;float:left;margin-right:5px;">
                <option value="0">付费状态</option>
				<option value="1" <if condition="I('pay_status') eq 1">selected</if> >已付费</option>
				<option value="2" <if condition="I('pay_status') eq 2">selected</if> >未付费</option>
            </select>
			<select name="order_cate2" class="select input-text" style="width:150px;float:left;margin-right:5px;">
                <option value="0">订单类型</option>
				<option value="1" <if condition="I('pay_status') eq 1">selected</if> >现货</option>
				<option value="2" <if condition="I('pay_status') eq 2">selected</if> >直邮</option>
				<option value="3" <if condition="I('pay_status') eq 2">selected</if> >保税</option>
            </select>
			日期范围:
			<input type="input-text" name="start_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="start_time" class="input-text Wdate" style="width:160px;" value="<{$_GET['start_time']}>"  placeholder="开始时间"> -
			<input type="input-text" name="end_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="end_time" class="input-text Wdate" style="width:160px;"  value="<{$_GET['end_time']}>"    placeholder="结束时间">
			<img src="__PUBLIC__/img/flag/flag_green.png">
			<input type="radio" name="flag" value="1" checked="">
			<img src="__PUBLIC__/img/flag/flag_yellow.png"></img>
			<input type="radio" name="flag" value="2">
			<img src="__PUBLIC__/img/flag/flag_red.png">
			<input type="radio" name="flag" value="3">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
			<a href="javascript:;" onclick="admin_open('添加','__URL__/add_order/',0,'1000','680')" class="btn btn-primary radius btn_big"><i class="Hui-iconfont"></i> 添加</a>
			<a href="javascript:;" onclick="importexcelAll()" class="btn btn-primary radius btn_big">批量导入</a>
			<a href="javascript:;" onclick="exportExcel()" class="btn btn-primary radius">批量导出</a>
			<!-- <a href="javascript:;" onclick="push()" class="btn btn-primary radius">推送</a> -->
			<a href="javascript:;" onclick="delAll()" class="btn btn-danger radius">批量删除</a>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">订单列表</th>
			</tr>
			<tr class="text-c">
				<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name="" value=""></th>
				<th width="25">序号</th>
				<th width="75">收件人</th>
				<th width="75">发件人</th>
				<th width="">商品名称</th>
				<th width="">数量</th>
				<th width="">单价</th>
				<th width="">总价</th>
				<th width="">备注1</th>
				<th width="">备注2</th>
				<th width="">运单号</th>
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input type="checkbox" value="<{$vo.id}>" name="" class="ids"></td>
				<td><{$i}></td>
				<td><{$vo.user_name}></td>
				<td><{$vo.sendman}></td>
				<td>
				<foreach name="vo.goods_list" key="i" item="vs">
					<if condition="$i GT 0"><br></if>
					<{$vs.goods_name}>
				</foreach>
				</td>
				<td>
				<foreach name="vo.goods_list" key="i" item="vs">
					<if condition="$i GT 0"><br></if>
					<{$vs.goods_nums}>
				</foreach>
				</td>
				<td>
					<foreach name="vo.goods_list" key="i" item="vs">
						<if condition="$i GT 0"><br></if>
						<{$vs.goods_price}>
					</foreach>
				</td>
				<td>
					<{$vo.total_price}>
				</td>
				<td>
					<{$vo.mark1}>
				</td>
				<td>
					<{$vo.mark2}>
				</td>
				<td>
					<a href="javascript:;" style="color:blue;" onclick="admin_open('快递状态','__MODULE__/Ems/index/mail_no/<{$vo.logistics_no}>','<{$vo.logistics_no}>','800','480')" >
						<{$vo.logistics_no}>
					</a>
				</td>
				
				<!-- <td><{$vo.user_phone}></td> -->
				<!-- <td><{$vo.province}><{$vo.city}><{$vo.area}><{$vo.user_address}></td> -->
				<!-- <td> -->
				<!-- <if condition="$vo.flag eq 1"> -->
					<!-- <img src="__PUBLIC__/img/flag/flag_green.png"> -->
				<!-- </if> -->
				<!-- <if condition="$vo.flag eq 2"> -->
					<!-- <img src="__PUBLIC__/img/flag/flag_yellow.png"> -->
				<!-- </if> -->
				<!-- <if condition="$vo.flag eq 3"> -->
					<!-- <img src="__PUBLIC__/img/flag/flag_red.png"> -->
				<!-- </if> -->
				<!-- </td> -->
				<!-- <td> -->
				<!-- <if condition="$vo.pay_status eq 1"> -->
					<!-- 已付款 -->
				<!-- </if> -->
				<!-- <if condition="$vo.pay_status eq 2"> -->
					<!-- <span style="color:red">未付款</span> -->
				<!-- </if> -->
				<!-- <if condition="$vo.pay_status eq 0"> -->
					<!-- 未设置 -->
				<!-- </if> -->
				<!-- </td> -->
				<!-- <td> -->
				<!-- <if condition="$vo.order_cate2 eq 1"> -->
					<!-- <span style="color:blue">现货</span> -->
				<!-- </if> -->
				<!-- <if condition="$vo.order_cate2 eq 2"> -->
					<!-- <span style="color:red">直邮</span> -->
				<!-- </if> -->
				<!-- <if condition="$vo.order_cate2 eq 3"> -->
					<!-- <span style="color:yellow">保税</span> -->
				<!-- </if> -->
				<!-- </td> -->
				<td>
					<a href="javascript:;" onclick="admin_open('详细','__URL__/order_detail/id/<{$vo.id}>','<{$vo.id}>','1200','680')" class="">详细</a>
					<a href="javascript:;" onclick="admin_open('编辑','__URL__/edit_order/id/<{$vo.id}>','<{$vo.id}>','1000','780')" class="">编辑</a>
					<a title="删除" href="javascript:;" onclick="admin_del('__URL__/del_order/','<{$vo.id}>')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
				</td>
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right"><{$page}></div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	//推送
	function push(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: "<{:U('pushoms')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	function importexcelAll(id){
        var index=layer.open({
            type: 2,
            title: '导入数据',
            shadeClose: true,
            shade: 0.5,
            area: ['1000px', '150px'],
            content: '__MODULE__/import/importPushorder/'+Math.random() //iframe的url
        });
    }
	function exportExcel(){
		var url="<{:U('Order/order',array('excel'=>1))}>/?1=1";
		logistics_no=$('input[name=logistics_no]').val();
		order_no=$('input[name=order_no]').val();
		user_name=$('input[name=user_name]').val();
		user_idcard=$('input[name=user_idcard]').val();
		user_phone=$('input[name=user_phone]').val();
		user_address=$('input[name=user_address]').val();
		
		pay_status=$('select[name=pay_status]').val();
		goods_name=$('input[name=goods_name]').val();
		sendMan=$('input[name=sendMan]').val();
		
		start_time=$('input[name=start_time]').val();
		end_time=$('input[name=end_time]').val();
		
		if(pay_status!=0){
			url=url+"&pay_status="+pay_status;
		}
		if(goods_name!=""){
			url=url+"&goods_name="+goods_name;
		}
		if(sendMan!=""){
			url=url+"&sendMan="+sendMan;
		}
		
		if(logistics_no!=""){
			url=url+"&logistics_no="+logistics_no;
		}
		if(order_no!=""){
			url=url+"&order_no="+order_no;
		}
		if(user_name!=""){
			url=url+"&user_name="+user_name;
		}
		if(user_idcard!=""){
			url=url+"&user_idcard="+user_idcard;
		}
		if(user_phone!=""){
			url=url+"&user_phone="+user_phone;
		}
		if(user_address!=""){
			url=url+"&user_address="+user_address;
		}
		if(start_time!=""){
			url=url+"&start_time="+start_time;
		}
		if(end_time!=""){
			url=url+"&end_time="+end_time;
		}
		window.location.href=url;
	}
	//批量删除
	function delAll(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: "<{:U('delAll_order')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.info,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.info);
					}
					return false;
				}
			})
		}
	}
</script>
 <include file="Public/footer" />
<include file="Public/footer_js" />
</body>
</html>